package com.java;

import com.java.bean.User;
import net.sf.json.JSONObject;

/**
 * @Author: wjr
 * @Description:
 * @Date Created in  2020-09-08 23:52
 * @Modified By:
 */
public class Main {
    public static void main(String[] args) {
        User user = new User(1, "关羽");
        JSONObject jsonObject = JSONObject.fromObject(user);
        System.out.println(jsonObject.toString());
        User u = (User) JSONObject.toBean(jsonObject, User.class);
        System.out.println(u);
    }
}
